package edu.cque.sp02.service;

import edu.cque.sp01.entity.Item;
import edu.cque.sp01.service.ItemService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Hua
 * @create 2022-08-17 15:49
 */
@Service
@Slf4j
public class ItemServiceImpl implements ItemService {
    @Override
    public List<Item> getItems(String orderId) {
        log.info("获取商品列表, orderId= " + orderId);
        List<Item> list = new ArrayList<>();
        list.add(new Item(5, "dsaf", 2));
        list.add(new Item(5, "dsaf", 2));
        list.add(new Item(5, "dsaf", 2));

        return list;
    }


    @Override
    public void decreaseNumbers(List<Item> lists) {
        for (Item list : lists) {
            System.out.println("减少库存----------list = " + list);
        }
    }
}
